#include<iostream>
class T
{
public:	int x,y;
	int a(){return x+y;}
	int s(){return x-y;}
	int m(){return x*y;}
	int d(){return y?x/y:-9999;}
}t;
int main()
{
	int n,r;
	char o;
	std::cin>>n;
	for(;n--;)
	{
		std::cin>>t.x>>t.y>>o;
		if(o==43)r=t.a();
		if(o==45)r=t.s();
		if(o==47)r=t.d();
		if(o==42)r=t.m();


		std::cout<<r<<std::endl;
	}
}
